package com.xzy.repository;

import com.xzy.entity.ReceiverEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 收货人管理
 *
 * @author xzy.xiao
 * @date 2022/8/18  13:56
 */
@Mapper
public interface ReceiverMapper {
    /**
     * 保存收货人信息
     *
     * @param entity 收货人信息
     * @return -
     */
    int save(ReceiverEntity entity);

    /**
     * 获取所有收货人信息
     *
     * @return -
     */
    List<ReceiverEntity> findAll();

    /**
     * 根据电话号码模糊查询收货人
     *
     * @param phone -
     * @return -
     */
    List<ReceiverEntity> findAllByPhoneLike(@Param("phone") String phone);

    /**
     * 根据收货人名称模糊查询收货人
     *
     * @param receiverName -
     * @return -
     */
    List<ReceiverEntity> findAllByReceiverNameLike(@Param("receiverName") String receiverName);

    /**
     * 清空数据库
     *
     * @return -
     */
    int deleteAll();
}
